    <template>
        <el-input-number v-model.number="discount"  :min="1" :max="10" v-bind="$attrs"></el-input-number>
    </template>

    <script>
        import Big from 'big.js'
        export default {
            name: "Discount",
            props:{
              value:{
                  type:Number,
                  default:10
              }
            },
            computed:{
                discount:{
                    get() {
                        return 10*this.value
                    },
                    set(currentValue) {
                        if (!currentValue) {
                            currentValue=10
                        }
                        let big = new Big(currentValue);
                        let actualValue = big.div(10).toPrecision(2);
                        this.$emit('input',Number(actualValue))
                    }
                }
            }
        }
    </script>

<style scoped>

</style>
